﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace SpectrEngine.Framework.Collision
{
    public class BoundingCircle
    {
        public Vector2 Center;
        public float Radius;

        public BoundingCircle(Vector2 center, float radius)
        {
            this.Center = center;
            this.Radius = radius;
        }

        public BoundingCircle(float x, float y, float radius)
        {
            this.Center = new Vector2(x, y);
            this.Radius = radius;
        }

        public BoundingCircle(BoundingCircle b, Matrix w)
        {
            this.Center = Vector2.Transform(b.Center, w);
            this.Radius = b.Radius;
        }

        public bool Intersects(BoundingCircle other)
        {
            return Math.Abs(Vector2.Distance(this.Center, other.Center)) < this.Radius + other.Radius;
        }
    }
}
